Repository navigation
drums preflight: check a run can start before any GPU is paid for - #13
Merged
Merged
Conversation
…admission, rate limit, quota, spend cap and task set before a run; drums.preflight() in Python
…ng; README section
…3.9; the same line as #10)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed (learnings doc "Preflight"; D1 blocks A-04, A-27, A-29, A-30 seen from the client)
drums preflight --desktops N --hours H [--model-gpus 2:6] [--task-set ID|name] [--json] [--strict]on the CLI, anddrums.preflight(desktops, hours, ...)returning aPreflightReport(.ok,.checks,.table(),.to_dict(),.exit_code(strict)). It only reads; it creates nothing.GET /v1/healthGET <console>/sign-in, no token sent/v1/healthplusGET /v1/api-keys, matched by key prefixcomputers:readandcomputers:writerequired;runs:writeandusage:readwarned/v1/healthcapacity/v1/health, plushost.statusfrom/v1/limitswhen presentREQUESTS_PER_DESKTOP_S(0.5, the D1 rule, explicit and documented), burst vs N xBURST_PER_DESKTOP(1.0)GET /v1/limits(not served yet)GET /v1/limits(not served yet)GET /v1/limits(not served yet);--desktop-hour-usdsupplies the priceGET /v1/task-sets/{id}, or a name looked up in the list--gpu-hour-usdfor a GPU cost projectionEvery row that is not a pass carries a fix and a console link (
/w/<slug>/usage,/api-keys,/computers,/tasks/<id>). The workspace slug comes from--workspaceorDRUMS_WORKSPACE. Exit status: 1 when a check failed, 2 on a usage error, 0 otherwise.--strictalso exits 1 on a warning or a row that could not be checked. The token never appears in any output.Graceful fallback. Rate limit, quota, spend cap and price need a read-only
GET /v1/limitssummary that no gateway serves yet. Until one does, those rows say "not checked (this gateway does not publish GET /v1/limits yet)" and never fail the run. The one exception: the rate limit row warns when N needs more than the gateway's 20/s, burst 60 default. The shape preflight reads is in_limits_view:I propose that W1 or W3 serve this (with scope
usage:read) together with the per-workspace rate profile and the desktop-hour price.Live run (read-only, against https://beta.drums.run/gw with the D1 key, merged locally with #11 for the certificate fix)
The first line is #11's certifi fallback in action. This macOS python.org Python has no root store, and without #11 the gateway row fails with
CERTIFICATE_VERIFY_FAILED, which is A-07 exactly. The console row has its own certifi retry, so it does not depend on #11.Tests
tests/test_preflight.py(17 tests, localhost fake gateway). It covers: today's gateway (passes what it can; rows it cannot check say so and pass non-strict); the explicit rate rule (128 desktops need 64 req/s, a warning against the 20/s default); with/v1/limitsevery row is decided; each limit fails with its fix and link; the price flag; host capacity and admission (full, drumsd not ok, stale checkpoint, draining); key expiring during the run, missing or wanted scopes; wrong key and another workspace; unreachable gateway; slow control plane; task set (missing, never validated, platform, rejected, by name, validated on another host); the console row; model GPUs; bad arguments; and the CLI table, exit codes,--json, usage errors, and no token in output.